package com.tencreat.mapper.mall;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tencreat.domain.mall.MallMessageConfig;
import com.tencreat.domain.mall.MallMessageList;
import com.tencreat.domain.mall.vo.MallMessageListVO;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 消息列Mapper接口
 *
 * @author tencreat
 * @date 2021-11-24
 */
public interface MallMessageListMapper extends BaseMapper<MallMessageList> {


    /**
     * 获取所有消息列表
     * @return 结果
     */
    List<MallMessageListVO> list(@Param("today") Integer isToday,@Param("mobile") String mobile);

    Long unreadMessageSum();

    /**
     * 获取app未读消息
     * @param userId 用户UUID
     * @return 未读消息数量
     */
    Integer getAppUnreadMessage(Long userId);


    /**
     * 清空App未读消息
     * @param userId 用户UUID
     */
    void clearAppUnreadMessage(Long userId);

    void clearAppUnreadStatus(Long userId);

    /**
     * APP获取所有消息列表
     * @return 结果
     */
    List<MallMessageListVO> listByUserId(Long userId);

    MallMessageConfig queryMessageConfig(LocalDateTime dateTime);

    Integer receptionToday();
}
